﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Studentium.UIElements
{
    public partial class LoginDialog : Form
    {
        public LoginDialog()
        {
            InitializeComponent();
            loginBtn.DialogResult = DialogResult.None;
        }

        private void loginBtn_Click(object sender, EventArgs e)
        {
//            if (passwordBox.Text == "youaredimond")
//            {
//                DialogResult = DialogResult.Yes;                
//            }
//            else
//            {
//                MessageBox.Show("Incorrect password");
//                DialogResult = DialogResult.No;
//            }
            DialogResult = DialogResult.Yes;
            MainForm.password = passwordBox.Text;
            Close();
        }

        private void LoginDialog_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (DialogResult == DialogResult.None)
                DialogResult = DialogResult.No;
        }
    }
}
